function main(params) {

    const { mediaUid } = params;
    if (!mediaUid) {
        return;
    }

    if (window.parent) {
        try {
            window.parent.postMessage(
                { type: 'preview', data: { mediaUid } },
                '*'
            );
        } catch (error) {
            console.error('Failed to post message:', error);
        }
    } else {
        console.warn('No parent window found. Message not sent.');
    }
}
